package com.jiu345.api.controller;

import com.jiu345.api.pojo.Brand;
import com.jiu345.api.pojo.CategoryBrand;
import com.jiu345.api.service.IBrandService;

import com.jiu345.core.page.PageQuery;
import com.jiu345.core.page.TableDataInfo;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * package:GoodsCateController
 * @author MrLei QQ:235921049
 * @date 2024-05-21
 * desc:商品
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/goods/brand")
public class BrandController extends BaseController {
    private final IBrandService brandService;


    /*查询所有品牌*/
    @GetMapping("/all")
    public TableDataInfo<Brand> list(Brand bo, PageQuery pageQuery){
        return brandService.queryPageList(bo,pageQuery);
    }
    /*根据分类id查询品牌*/
    @GetMapping("/list")
    public TableDataInfo<CategoryBrand> selectByCategoryId(CategoryBrand bo, PageQuery pageQuery){
        return brandService.selectByCategoryIdPageList(bo,pageQuery);
    }
}
